package com.wyz.saas.common.view

import android.content.Context
import android.graphics.Rect
import android.os.Build
import android.util.AttributeSet
import androidx.annotation.RequiresApi
import com.wyz.saas.common.view.airpanel.AirPanelLinearLayout

class MessageLayout : AirPanelLinearLayout {

    constructor(context: Context) : super(context)
    constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
    constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
        context,
        attrs,
        defStyleAttr
    )

    @RequiresApi(Build.VERSION_CODES.LOLLIPOP)
    constructor(
        context: Context?,
        attrs: AttributeSet?,
        defStyleAttr: Int,
        defStyleRes: Int
    ) : super(context, attrs, defStyleAttr, defStyleRes)

    override fun fitSystemWindows(insets: Rect): Boolean {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            insets.left = 0
            insets.top = 0
            insets.right = 0
        }
        return super.fitSystemWindows(insets)
    }
}